<HTML><HEAD><TITLE>licence_heartbeat(+Feature, +Minutes, -Reconnects, -FailedReconnects)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(flexlm)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>licence_heartbeat(+Feature, +Minutes, -Reconnects, -FailedReconnects)</H1>
Refresh a checked out FlexLM licence
<DL>
<DT><EM>Feature</EM></DT>
<DD>String or atom
</DD>
<DT><EM>Minutes</EM></DT>
<DD>Integer
</DD>
<DT><EM>Reconnects</EM></DT>
<DD>Returns count of reconnects within last Minutes minutes
</DD>
<DT><EM>FailedReconnects</EM></DT>
<DD>Returns 0 if ok, otherwise count of failed reconnects
</DD>
</DL>
<H2>Description</H2>

	This maps directly to lp_heartbeat() of the FlexLM simple API.
	<P>
	An application should call licence_heartbeat/4 occasionally (e.g.
	every few minutes) in order to make sure that the licence server
	is still running. When everything is ok, zero is returned in the
	last argument, otherwise the number of failed connection attempts.
	<P>
	The second and third argument allow to check whether the licence
	server has been shut down and restarted. If that happens, the
	heartbeat call will reconnect to the server. If many such
	reconnects happen in a short amount of time, this is suspicious
	and may indicate an attempt to illegally obtain more licences.
	<P>
	If a feature had been checked out multiply, a heartbeat is performed
	for every checked out licence, and the reconnection counts are
	added up.
    
<H3>Fail Conditions</H3>
Fails if the given feature has not been checked out
<H2>Examples</H2>
<PRE>
	...,
    	( sepia_kernel:licence_heartbeat(swapper, 10, R, 0) -&gt;
	    ( R &gt; 3 -&gt;
		writeln(error, "Licence server suspicious"),
		abort
	    ;
		true
	    )
	;
	    writeln(error, "Licence server not responding"),
	    abort
	),
	...
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/flexlm/licence_checkout-6.html">licence_checkout / 6</A>, <A HREF="../../lib/flexlm/licence_checkin-1.html">licence_checkin / 1</A>, <A HREF="../../lib/flexlm/licence_held-1.html">licence_held / 1</A>
</BODY></HTML>
